package com.ys.service.purchase;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.ys.vo.R;

import lombok.AllArgsConstructor;
import lombok.Data;

public interface Api1688Service {

	R viewOrderBeforeCreate(String orderNo);
	@Data
	@AllArgsConstructor
	public class ViewOrderBeforeCreateDto{
		private List<RowDto> rows; // 数据行
		
		@Data
		@AllArgsConstructor
		public static class RowDto {
			private String promotionId; // 优惠ID
			private boolean selected; // 是否选中
			private String text; // 优惠名称
			private BigDecimal discountFee; // 优惠金额
		}
	}

	/**
	 * 通过code换取1688 accessToken
	 * @param code
	 * @return
	 */
	R get1688Token(String code);
	
	String getAccessToken();

	R get1688ProductDetail(String code);

	String get1688ResourceOwner();

	R create1688Order(String orderNos);

    /**
     *
     * @param system
     * @param type
     * @param dataParams 格式为{"orderNos":"PO-220831-000001,PO-220831-000002","userId":"0000","cancelReason":""}
     * @return
     */
    R cancel1688Order(String orderNos, String cancelReason,boolean planIsCancel);

	/**
	 * 获取1688采购订单详细信息
	 * @param orderNos 格式为"orderNo":"PPO-220831-000002"
	 * @return
	 */
	R get1688OrderDetail(String orderNos);

	/**
	 * 获取1688采购订单物流跟踪信息
	 * @param orderNo 订单号
	 * @return
	 */
	R get1688OrderTraceInfo(String orderNo);


	/**
	 * 获取1688支付URL地址
	 * @param aliOrderNos 1688订单号多个用逗号分开
	 * @return
	 */
	R get1688AlipayUrl(String aliOrderNos);


	/**
	 * 1688PUSH的消息处理
	 * @param dataParams
	 * @return
	 */
	R push1688Message(Map<String, Object> dataParams);

	/**
	 * 获取1688采购订单物流信息
	 * @param bid 采购订单单号
	 * @return
	 */
	R get1688OrderLogisticsInfo(String orderNo);

	BigDecimal get1688OrderAmountApi(String orderNo);

	/**
	 * 获取1688订单状态并修改采购完成单订单状态
	 * @param aliOrderNumber  1688订单标识
	 * @return
	 */
	R get1688AliState(String aliOrderNumber);
}